<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
    <style>
        a{
            margin: 0 auto;
        }
        #arr4{
            display:block;
            text-align: center;
            width: 300px;
            height: 40px;
            line-height:40px;
            background: orange;
            color: white;
            border-radius: 2px;
            box-shadow: 0 5px 0 0 lightgrey;
        }
        .disable {
            background: #d6d6d6 !important;
            color: #999 !important;
        }
    </style>
</head>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">加载中...</span> <span>先到先得</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="{:U('Index/activity')}" class="iconfont back"></a>
    </header>

    <div data-v-3cbfc35c="" class="activityMian main" s="[object Object]">
        <div data-v-3cbfc35c="" class="activiTop"><img data-v-3cbfc35c="" alt="" width="100%" src="/style/images/sjxiandao.png">
            <div data-v-128082f2="" class="rewardStatus">
                <input type="hidden" value="{$id}" id="uid4">
                <em data-v-128082f2="" class="e1">今日投注：
                    <i data-v-128082f2="">
                        <input id="jinritouzhu" type="text" value="<?php if($arr4['level']==''){echo '未登录';}else{echo $touzhu1;};?>" class="xian" style="border: hidden;color: orangered;width: 80px" readonly>
                    </i>
                </em>
                <em data-v-128082f2="" class="e3">余&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额：
                    <i data-v-128082f2="">
                        <input type="text" value="<?php if($arr4['level']==''){echo '0.00';}else{echo $Accountsinfo['money'];};?>" class="yue" style="border: hidden;color: orangered;width: 80px" readonly>
                    </i>
                </em>
                <input type="hidden" value="{$count}" id="count">
                <input type="hidden" value="{$count2}" id="count2">
                <input type="hidden" value="{$stimes12}" id="stimes12">
                <input type="hidden" value="{$etimes12}" id="etimes12">
                <input type="hidden" value="{$stimes13}" id="stimes13">
                <input type="hidden" value="{$etimes13}" id="etimes13">
                <input type="hidden" value="{$timess}" id="timess">
            </div>
            <div id="cen">
                <a data-v-5be8b080="" href="javascript:;" id="arr4" class="<?php if($arr4['type']=='4' && $arr4['is_lingqu']!='0'){echo 'disable';} ?>  dianji4" >
                    领取
                </a>
            </div>
        </div>

        <h3 data-v-3cbfc35c="">活动说明</h3>

        <div data-v-3cbfc35c="" class="wrapExplain">
            <p>
                1.每场开放30个宝箱，先到先得；
            </p>
            <p>
                2.每天分为两场：上半场时间8:30到12:30，下半场时间:18:30到22:30；
            </p>
            <p>
                3.用户消费888且余额大于88可在开发时间内最高可领取1888奖励
            </p>
        </div>
    </div>
    <!--弹框 begian-->
    <div id="dengji" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">请登录
                    </div>
                    <div class="layermbtn"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--弹框 end-->
    <!--弹框 begian-->
    <div id="cuowu" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">
                        <p>1.该奖金已经领取</p>
                        <p>2.每场开放30个宝箱,请您在上半场8:30到12:30或下半场18:30到22:30领取</p>
                        <p>3.用户消费未满888元或余额没有大于88元</p>
                    </div>
                    <div class="layermbtn"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--弹框 end-->
    <!--弹框 begian-->
    <div id="lingqu3" class="layermbox layermbox0 layermshow" index="10" style="display: none">
        <div class="laymshade"></div>
        <div class="layermmain">
            <div class="section">
                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                    <button class="layermend"></button>
                    <div class="layermcont">领取成功
                        <p>
                            金额为：<input type="text"  class="fff" style="border: hidden;color: orangered;width: 60px" readonly>
                        </p>

                    </div>
                    <div class="layermbtn"><span type="1">确定</span></div>
                </div>
            </div>
        </div>
    </div>
    <!--弹框 end-->
</div>
</body>
</html>
<script>
    $(".layermbtn").click(function(){
        $(".layermbox").hide();
        window.location.href = "";
    });

    //先到先得未登录
    var touzhu11 = $("#jinritouzhu").val();
    if(touzhu11=='未登录'){
        $(".dianji4").addClass("disable");
    }

    //个数判断
    var count = $("#count").val();

    if(count == 30){
        $(".dianji4").addClass("disable");
    }
    var count2 = $("#count2").val();
    if(count2 == 30){
        $(".dianji4").addClass("disable");
    }

//时间判断  上半场
    var stimes12 = $("#stimes12").val();
    var etimes12 = $("#etimes12").val();
    var timess = $("#timess").val();
    if(timess<stimes12 && timess>etimes12){
        $(".dianji4").addClass("disable");
    }

//时间判断  下半场
    var stimes13 = $("#stimes13").val();
    var etimes13= $("#etimes13").val();
    if((etimes12<timess && timess<stimes13) && (timess>etimes13)){
        $(".dianji4").addClass("disable");
    }

    var touzhu = $(".xian").val();
    var touzhu2 = parseInt(touzhu);
    var shengyu = $(".yue").val();
    var shengyu2 = parseInt(shengyu);
    if(touzhu2<888){
        $(".dianji4").addClass("disable");
    }
    if(shengyu2<88){
        $(".dianji4").addClass("disable");
    }

    $(".dianji4").click(function () {
        var uid = $("#uid4").val();
        if(uid==''){
            $("#dengji").show();
            return false;
        }
        var type = 4;
        if($("#arr4").hasClass("disable")){
            $("#cuowu").show();
            return false;
        }else {
            $.ajax({
                type: "POST",
                url: "{:U('Index/xiandaoxiande')}",
                data: {'type': type},
                success: function (dat) {
                    if(dat==2){
                        $(".dianji4").addClass("disable");
                        $("#cuowu").show();
                        return false;
                      }
                    var dat1 = dat;
                    var aaa = parseInt(dat1.substring(0, 1));
                    var bbb = parseInt(dat1.substr(1)) + '.00';
                    $(".fff").val(bbb);
                    if (aaa == 1) {
                        $(".dianji4").addClass("disable");
                        $("#lingqu3").show();
                    }
                }
            });
        }
    });

</script>